]> dgit.raspbian.org Git - gnome-shell.git/commit
iconGrid: Get max child size using existing array of visible children
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 25 Feb 2021 17:07:59 +0000 (18:07 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 3 Mar 2021 17:59:15 +0000 (17:59 +0000)
commit0978b87e65233ebb02e14173ed155ca71ea060b9
tree60b032684f17899e044c11db61fb6cf6b3d6038b
parent8e938064535a61f307740c10a10ddfb5196d6d1e
iconGrid: Get max child size using existing array of visible children

Using a preexisting array to iterate over is much faster than iterating
over the actors children using a "for ... of" loop, that's because the
latter calls into C functions to get the next actor all the time.

Also, stop using array deconstruction here, it turned out that this is
extremely expensive. When profiling this part of the code, it turned out
that only 9% of the time spent in _getChildrenMaxSize() is spent calling
the get_preferred_height/width() methods. When not using array
deconstruction, this time increased to 22%, still not great, but a lot
better.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1713>
js/ui/iconGrid.js